﻿using UnityEngine;
using System;
using System.Collections.Generic;

public enum XHitReactAnimationType
{
    None,
    Hit,
    BlockHit,
    HeavyHit,
}

[System.Serializable]
public class XHitReact
{
    [HideInInspector, System.NonSerialized]
    public Quaternion hitPointRot;
    [HideInInspector, System.NonSerialized]
    public Vector3 hitPoint;

    [Header("Audio")]
    public GameObject hitAudioClip;

    [Header("Effects [level, effect]")]
    public XEffectConfigObject[] hitEffects;

    [Header("Hit")]
    public XHitReactAnimationType hitGround = XHitReactAnimationType.Hit;
    public XHitReactAnimationType hitAir = XHitReactAnimationType.None;
    public XHitReactAnimationType hitBlock = XHitReactAnimationType.None;
}

public enum XAttackCheckType
{
    /// <summary>
    /// 默认，近战
    /// </summary>
    Normal = 0,

    /// <summary>
    /// 子弹，远程
    /// </summary>
    Bullet = 1,
}

[CreateAssetMenuAttribute]
public class XAttackFrameObject : ScriptableObject
{
    [SerializeField, HideInInspector]
    public string AssetGUID = string.Empty;

    [HideInInspector, System.NonSerialized]
    public string attackName = string.Empty;

    public long frameSenerId = 0;

    public HumanBodyBones bone;
    public Vector3 position;
    public Quaternion rotation;
    public float range;

    [Header("Check Type")]
    public XAttackCheckType checkType = XAttackCheckType.Normal;
    public GameObject bulletPrefab;
    public XBoneNogType fireNogType;
    [HideInInspector]
    public Vector3 fireOffset;

    [System.NonSerialized]
    public int dmgCurrent = 1;
    [System.NonSerialized]
    public int dmgTotal = 1;
    [System.NonSerialized]
    public int dmgRate = 100;

    [Header("Hit Radial Blur")]
    public bool blur = false;
    public float blurDist = 0.1f;
    public float blurStrength = 3.5f;
    public int blurFrame = 3;

    [Header("Hit react")]
    public XHitReact react;
}


